﻿using StructureMap;
using TimeTracker.Core.Services;
using TimeTracker.Web.Account.Interface;

namespace TimeTracker.Web.Account.Presenter
{
    public class PrijavaPresenter
    {
        private IPrijavaView _view;
        private IKorisnikService _korisnikService;

        public void Init(IPrijavaView view)
        {
            _view = view;
            _korisnikService = ObjectFactory.GetInstance<IKorisnikService>();
            ObjectFactory.GetInstance<IRedirectorService>();
        }

        public void Prijava(string username, string lozinka)
        {
            var message = _korisnikService.Prijavi(username, lozinka);
            _view.PrikaziPoruku(message);
        }

    }
}
